Recursion Depth Analysis for Specail Tree Traversal Algorithms

نویسندگان

  • Peter Kirschenhofer
  • Helmut Prodinger
چکیده

In this paper we are concerned with the analysis of special recursive algorithms for traversing the nodes of a planted plane tree (ordered tree ; planar tree) . Some by now classical results in this area are due to KNUTH [7], DE BRUIJN, KNUTH and RICE [1], FLAJOLET [2], FLAJOLET and ODLYZKO [3], FLAJOLET, RAOULT and VUILLEMIN [4], KEMP [6] and others and are summarized in the next few lines : The most important .tree structure in Computer Science are the binary trees . The inorder traversal (KNUTH [7]) is the following recursive principle : Traverse the left subtree Visit the root Traverse the right subtree . The most straightforward implementation uses an auxiliary stack to keep necessary nodes of the tree . . The analysis of the expected time of the visit procedure is clearly linear in the size of the input tree . To evaluate recursion depth means to determine the average stack height as a function of the size of the tree . The recursion depth or height h of the binary tree is recursively determined as follows : If the family B of binary trees is given by the symbolic equation

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

On the Recursive Depth of Special Tree Traversal Algorithms

In this paper we are concerned with the analysis of special recursive algorithms for traversing the nodes of a planted plane tree (ordered tree ; planar tree) . Some by now classical results in this area are due to (de Bruijn, Knuth, and Rice, 1972 ; Knuth, 1973 ; Flajolet, 1981 ; Flajolet and Odlyzko, 1982 ; Flajolet, Raoult, and Vuillemin, 1979 ; Kemp, 1979) and others and are summarized in t...

متن کامل

An improved algorithm to reconstruct a binary tree from its inorder and postorder traversals

It is well-known that, given inorder traversal along with one of the preorder or postorder traversals of a binary tree, the tree can be determined uniquely. Several algorithms have been proposed to reconstruct a binary tree from its inorder and preorder traversals. There is one study to reconstruct a binary tree from its inorder and postorder traversals, and this algorithm takes running time of...

متن کامل

An improved algorithm to reconstruct a binary tree from its inorder and postorder traversals

It is well-known that, given inorder traversal along with one of the preorder or postorder traversals of a binary tree, the tree can be determined uniquely. Several algorithms have been proposed to reconstruct a binary tree from its inorder and preorder traversals. There is one study to reconstruct a binary tree from its inorder and postorder traversals, and this algorithm takes running time of...

متن کامل

Review: Kd-tree Traversal Algorithms for Ray Tracing

In this paper we review the traversal algorithms for kd-trees for ray tracing. Ordinary traversal algorithms such as sequential, recursive, and those with neighbor-links have different limitations, which led to several new developments within the last decade. We describe algorithms exploiting ray coherence and algorithms designed with specific hardware architecture limitations such as memory la...

متن کامل

The Smalltalk Idioms: Object-Oriented Recursion

U nderstanding recursion is a watershed in the life of most software developers. The idea that you define a computation, not in terms of other computations, but in terms of itself, is a mind bender for most people. I can remember carefully drawing stack frames with their own local storage and program counter and painstakingly following the progress of factorial and depth-first binary tree trave...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1984